package factory.simple;

/**
 * @description: 简单工厂类，通过参数得到动物实例
 * @author: Fesine
 * @createTime:2016/8/26 21:49
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/8/26 21:49
 */
public class AnimalFactory {
    public static Animal createAnimal(AnimalType anType) {
        switch (anType) {
            case CAT:
                return new Cat();
            case DOG:
                return new Dog();
            default:
                return new Duck();
        }
    }
}
